package Twice.day11;

import java.util.Iterator;
import java.util.LinkedList;

/**
 * @Author: lya
 * @Description: 本类的作用描述:
 * @CreateDate: 2019/8/6
 * @Version: 1.0
 */
public class PushPopDemo {
    public static void main(String[] args) {
        //创建一个LinkedList对象
        LinkedList<String> list = new LinkedList<>();
        list.push("java");
        list.push("oracle");
        list.push("mysql");

        System.out.println(list.pop());//mysql

        Iterator<String> iter = list.iterator();
        while(iter.hasNext()){
            System.out.println(iter.next());
        }
    }
}
